<div class="container-fluid">
  <div class="row">
    <div class="col-xs-12">
    <div class="btn-group btn-group-justified">
      <a href="/access_monitors?key=13551031965" class="btn btn-primary">全部(<%= @total %>)</a>
      <a href="/access_monitors?key=13551031965&filter=white_list" class="btn btn-info">白名单(<%= @white_list_total %>)</a>
      <a href="/access_monitors?key=13551031965&filter=black_list" class="btn btn-success">黑名单(<%= @black_list_total %>)</a>
    </div>
    </div>
  </div>
  <div class="row">
    <div class="col-xs-12">
      <table class="table table-strip">
        <tr>
          <td>#</td>
          <td>ip</td>
          <td>访问次数</td>
          <td>白/黑名单</td>
          <td>时间</td>
          <td>操作</td>
        </tr>
        <% index = 1 %>
        <% @access_records.each do |access_record| %>
        <tr>
          <td><%= index %></td>
          <td><%= access_record.ip_address %></td>
          <td><%= access_record.access_count %></td>
          <td><%= access_record.updated_at %></td>
          <td><%= access_record.is_trust ? '白名单' : '黑名单' %></td>
          <td><a href="/access_monitors/<%= access_record.id %>?filter=<%= params[:filter]%>" class="btn btn-white">加入<%= access_record.is_trust ? '黑名单' : '白名单' %></a></td>
        </tr>
        <% index += 1 %>
        <% end %>
      </table>
    </div>
  </div>
</div>
